
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.kma.ncpractice2013.auth.RegistrationServlet" %>
<%@ page import="com.kma.ncpractice2013.dao.UserDAO" %>
<%@ page import="com.kma.ncpractice2013.model.User" %>
<%@ page import="com.kma.ncpractice2013.dao.UserGroupDAO" %>
<%@ page import="com.kma.ncpractice2013.model.UserGroup" %>
<%@ page import="com.kma.ncpractice2013.model.Commission" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Register</title>
<link rel="stylesheet" href="register.css" />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/start/jquery-ui.css" />
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="jquery.validate.js"></script>
<script type="text/javascript" src="register.js"></script>

<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
</head>

<body>

<div id="header-wrapper">
<div id="header" class="container">
	<div id="logo">
    	<h1><a href="#">Accommodation</a></h1>
    </div>
        <%

        out.print("<div id=\"auth\">" +
                                  "<form method=\"post\" action=\"Auth\">"+
                          "        <input size=\"20\" type=\"text\" placeholder=\"e-mail\" name=\"username\">\n" +

                          "        <input size=\"15\" type=\"password\" placeholder=\"password\" name=\"password\">\n" +
                          "        <input type=\"submit\" value=\"Log in\"> \n" +
						  "        <a href=\"/openid?op=Google\"><img src=\"google_logo.jpg\" id=\"openid-image\" title=\"Login via OpenID account\"></a> \n" + 
                          "        <a id=\"regist\" href=\"register.jsp\">Register</a>\n" +
                                "</form>"+
						  "        <br clear=\"all\"><a id=\"reset_pass\" href=\"resetPassword.jsp\">Forgot your password?</a>\n" +
                          "    </div>\n");
    %>
</div>
</div>

<div id="reg-wrapper">
<div id="reg-panel">
    <form method="post" action="Reg" id="reg-form">
    <fieldset>
    	<legend>Register in Accommodation</legend>
        <p>
            <label for="r_login">E-mail</label>
            <input id="r_login" type="text" name="r_login" size="30">
        </p>
        <p>
            <label for="r_password">Password</label>
            <input id="r_password" type="password" name="r_password" size="30">
        </p>
        <p>
            <label for="r_cpassword">Confirm password</label>
            <input id="r_cpassword" type="password" name="r_cpassword" size="30">
        </p>
        <p>
            <label for="r_username">First name</label>
            <input id="r_username" type="text" name="r_username" size="30">
        </p>
        <p>
            <label for="r_surname">Last name</label>
            <input id="r_surname" type="text" name="r_surname" size="30">
        </p>
        <p>
            <label for="r_phone">Phone</label>
            <input id="r_phone" type="text" name="r_phone" size="30">
        </p>
        <p align="center">
        	<input id="button" type="submit" value="Register"/>
        </p>
    </fieldset>
    </form>
</div>
</div>
<%
    String err = request.getParameter("errcode");
    //test
    if(err != null && err.charAt(0) == RegistrationServlet.USERNAME_NOT_UNIQUE)
        out.print("<p/>username already exists");
%>

<div id="copyright-wrapper">
<div id="copyright" class="container">
<p>Copyright (c) 2013. All rights reserved.</p>
</div>
</div>

</body>

</html>
